<extend name="template/base_index" />
<block name="area_header">
	<script src="__LEARUN__/js/index.js"></script>
</block>
<block name="area_body">
	{:W('Menus/topbar')}
	<div class="admin-main container-fluid">
		{:W('Menus/left')}
		<div class="admin-main-content">
			{:W('Menus/breadcrumb')}
			<notempty name="parent_vo">
			<div class="text-center">
                <h4>类目规格关联管理 </h4>
            </div>
			</notempty>
            <div class="alert alert-info">
                 注意:将规格与类目进行关联操作
            </div>
			<!-- 过滤\查询按钮 -->
				<div class="filter-controls">
					<!-- 日期查询 -->
					<form action="{:U('Admin/CategorySku/relation')}" method="post" class="form-inline" id="fm">
						<div class="form-group">
							<label>类目名称</label>
							<input type="text" name="name" placeholder="请输入类目名称" value="{$name}" class="form-control input-short input-sm"/>
						</div>
						<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
					</form>
				</div>
				<!-- 操作按钮 -->
				<div class="btn-controls">
				</div>
				<table style="width: 640px;" class="table table-striped table table-hover table-condensed">
					<thead>
						<tr>
							<th width="180px;">
								id
								<!--<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />-->
							</th>
							<th width="180px;">
								名称
							</th>
							<th width="180px;" class="fp">
								规格管理
							</th>
						</tr>
					</thead>
					<tbody>
						<empty name="list">
							<tr>
								<td colspan="4" class="text-center">{:L('NO_DATA')}</td>
							</tr>
							<else/>
							<volist name="list" id="vo">
								<tr>
									<td>
										{$vo.id}
									</td>
									<td>{$vo.name}
									</td>
									<td>
											<a   href="{:U('Admin/CategorySku/index',array('cate_id'=>$vo['id'],'parent'=>$parent,'preparent'=>$preparent,'level'=>($level)))}">规格管理</a>
									</td>
								</tr>

							</volist>
						</empty>
					</tbody>
				</table>
				<div>{$show}</div>
			</div>
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
</block>

<block name="area_footer">
	<script>
		$(function () {
//			if($('#fp').attr('level') < 2){
//				$(".prop").hide();
//			}
			if($('#fp').attr('level') > 2){
				$(".prop").hide();
			}
			$('#startdatetime').datetimepicker({
				lang: 'ch',
				format:'Y-m-d',
				timepicker:false,
                timepickerScrollbar:false,
                scrollMonth:false,
                scrollTime:false,
                scrollInput:false
			});
			$('#enddatetime').datetimepicker({
				lang: 'ch',
				format:'Y-m-d',
				timepicker:false,
                timepickerScrollbar:false,
                scrollMonth:false,
                scrollTime:false,
                scrollInput:false
			});
			$("#sel").change(function () {
				$('#fm').submit();
			})
		})
	</script>
</block>